using System;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;

[Serializable]
public class PerfStandardWithGPU
{
    internal static string[] m_ArchitectureList = new[]
    {
        // Arm 5th Generation architecture
        "Immortalis-G720", "Mali-G720", "Mali-G620",
        // Valhall architecture
        "Mali-G715", "Mali-G710", "Mali-G615", "Mali-G610", "Mali-G510", "Mali-G310", "Mali-G78AE", "Mali-G78", "Mali-G77", "Mali-G68", "Mali-G57",
        // Bifrost architecture
        "Mali-G76", "Mali-G72", "Mali-G71", "Mali-G52", "Mali-G51", "Mali-G31",
        // Midgard architecture
        "Mali-T880", "Mali-T860", "Mali-T830", "Mali-T820", "Mali-T760", "Mali-T720"
    };
    
    [LabelText("GPU架构"), ValueDropdown(nameof(OnDropdownGPUArchitecture))]
    public string m_GPUArchitecture;
    
    [LabelText("材质最大Shader复杂度"), SuffixLabel("Cycles")]
    public float m_MaxShaderComplexity;

    [LabelText("特效Prefab的最大内存"), SuffixLabel("B")]
    public int m_MaxPrefabSize;

    [LabelText("最大贴图数量"), SuffixLabel("张")]
    public int m_MaxTextureCount;

    [LabelText("最大贴图内存"), SuffixLabel("B")]
    public int m_MaxTextureSize;

    [LabelText("最大平均Shader复杂度（特效平均）"), SuffixLabel("Cycles/Pixel")]
    public int m_MaxAvgShaderComplexityToEffect;

    [LabelText("最大平均Overdraw（特效平均）")]
    public int m_MaxAvgOverdrawToEffect;
    
    [LabelText("最大渲染批次")]
    public int m_MaxBatches;

    [LabelText("最大Renderer数量")]
    public int m_MaxRendererCount;

    [LabelText("最大粒子发射器数量")]
    public int m_MaxParticleSystemCount;

    [LabelText("最大粒子发射数量")]
    public int m_MaxParticleCount;

    [LabelText("备注")]
    public string m_Remarks;

    private ValueDropdownList<string> OnDropdownGPUArchitecture()
    {
        ValueDropdownList<string> v = new ValueDropdownList<string>();
        foreach (string architecture in m_ArchitectureList)
        {
            v.Add(architecture, architecture);
        }
        return v;
    }
}

// [CreateAssetMenu(fileName = "SfxPerformanceStandard", menuName = "SfxPerformanceStandard", order = 0)]
public class SfxPerformanceStandard : ScriptableObject
{
    [LabelText("性能标准")]
    public List<PerfStandardWithGPU> m_PerfStandards = new List<PerfStandardWithGPU>();
}